{\rtf0\ansi{\fonttbl\f0\fmodern Courier;}
\paperw11780
\paperh7800
\margl120
\margr120
{\colortbl;\red0\green0\blue0;}
\pard\tx540\tx1080\tx1620\tx2160\tx2700\tx3240\tx3780\tx4320\tx4860\tx5400\tx5940\tx6480\tx7020\tx7560\tx8100\tx8640\tx9180\tx9720\tx10260\tx10800\tx11340\f0\b0\i0\ulnone\fs24\fc0\cf0 #import "Stream.h"\
\

\b @implementation Stream : Object\

\b0 \
- 
\b initWithStream
\b0 :(NXStream *)
\i value
\i0 \
\{ [super init]; [self setStream:value]; return self; \}\
\
- 
\b initFromPasteboardType
\b0 :(const char *)
\i type
\i0 \
\{\
	id pb = [Pasteboard new];\

\fc1\cf1 	const char *t = [pb findAvailableTypeFrom:&
\fc0\cf0 type
\fc1\cf1  num:1];\

\fc0\cf0 	NXStream *s = [pb readTypeToStream:
\fc1\cf1 t];\
	return [self initWithStream:s];\
\}
\fc0\cf0 \
\
- 
\b openMemory
\b0  \{ stream = NXOpenMemory(NULL, 0, NX_READWRITE); return self; \}\
- 
\b openMemoryAt
\b0 :(char *)
\i data
\i0  
\b length
\b0 :(int)
\i length
\i0 ;\
\{ stream = NXOpenMemory(data, length, NX_READWRITE); return self; \}\
\
- 
\b rewind 
\b0 \{ NXSeek(stream, 0, NX_FROMSTART); return self; \}\
\
- 
\b close 
\b0 \{ NXCloseMemory(stream, NX_FREEBUFFER); return self; \}\
\
- (NXStream *)
\b stream
\b0  \{ return stream; \}\
- 
\b setStream
\b0 :(NXStream *)
\i value
\i0  \{ stream = value; return self; \}\
\
- 
\b free
\b0  \{ [self close]; return [super free]; \}\
\

\b @end
}
